<?php
$this->breadcrumbs = array(
    'Users' => array('admin'),
    $model->name,
);

$this->menu = array(
    array('label' => 'List User', 'url' => array('index')),
    array('label' => 'Create User', 'url' => array('create')),
    array('label' => 'Update User', 'url' => array('update', 'id' => $model->userId)),
    array('label' => 'Delete User', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->userId), 'confirm' => 'Are you sure you want to delete this item?')),
    array('label' => 'Manage User', 'url' => array('admin')),
);
$this->headTitle = "View User Details"
?>

<div class="widget">
    <div class="head">
        <h5 class="iFrames">User <?php echo $model->name; ?></h5>
    </div>
    <div class="body">
        <?php
        $this->widget('zii.widgets.CDetailView', array(
            'data' => $model,
            'cssFile' => Yii::app()->baseUrl . Constant::CDETAILVIEW_CSS_URL,
            'attributes' => array(
                'userId',
                'name',
                'password',
                'email',
                array(
                    'name' => 'sex',
                    'value' => $model->getSexText(),
                ),
                'dateOfBirth',
                'address',
                array(
                    'name' => 'messageSubscribed',
                    'value' => CHtml::encode($model->getMessageSubscribedText()),
                ),
                'createdDate',
                'updatedDate',
                'lastVisitDate',
//                'avatarUrl',
                array(
                    'type' => 'html',
                    'name' => 'avatarUrl',
                    'value' => CHtml::image(Yii::app()->baseUrl . Constant::USER_IMG_FOLDER_DISPLAY . $model->avatarUrl, "", array("width"=>"200", "height"=>"200")),
                ),
                array(
                    'name' => 'isDeleted',
                    'value' => Helper::getYesNoText($model->isDeleted),
                ),
            ),
        ));
        echo Helper::renderCrudToolTrashIncluded("user", "userId", $model->userId, $model->isDeleted);
//        echo '<div style="text-align:center">';
//        echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl . '/images/add.png', "", array("class"=>"topDir","original-title"=>"Add")), array("/user/create"));
//        echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl . '/images/edit.png', "", array("class"=>"topDir","original-title"=>"Edit")), array("/user/update", "id" => $model->userId));
//        if ($model->isDeleted == 0) {
//            echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl . '/images/recyclebin.png', "", array("class"=>"topDir","original-title"=>"Trash")), array("#"), array('submit' => array('trash', 'id' => $model->userId), 'confirm' => 'Are you sure you want to trash this item?'));
//        }
//        else
//            echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl . '/images/tick.png', "", array("class"=>"topDir","original-title"=>"Untrash")), array("/user/untrash", "userId" => $model->userId));
//        echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl . '/images/delete.png', "", array("class"=>"topDir","original-title"=>"Delete")), array("#"), array('submit' => array('delete', 'id' => $model->userId), 'confirm' => 'Are you sure you want to delete this item?'));
//        echo '</div>';
        ?>
    </div>
</div>
